import http from "@/http";
// /mall-admin/order/list 查询订单
export const getOrderListApi = (params: any): RES<ITableResult<OrderList>> => http.get('/order/list', { params })

// /mall-admin/orderSetting/{id} 获取指定订单设置
export const getOrderSettingApi = (id: number): RES<CustomType> => http.get(`/orderSetting/${id}`)

// /mall-admin/orderSetting/update/{id} 修改指定订单设置
export const getOrderSettingUpdateApi = (params: CustomType): RES<number> => http.post(`/orderSetting/update/${params.id}`, params)

// /mall-admin/returnApply/list 分页查询退货申请
export const getReturnApplyApi = (params: any): RES<ITableResult<ApplyList>> => http.get('/returnApply/list', { params })

// /mall-admin/order/delete 批量删除订单
export const getOrderDeleteApi = (id: number): RES<number> => http.post(`/order/delete?ids=${id}`)

// /mall-admin/order/{id} 获取订单详情：订单信息、商品信息、操作记录
export const getOrderApi = (id: number): RES<RootOrder> => http.get(`/order/${id}`)

// /mall-admin/order/update/note 备注订单
export const getUpdateNoteApi = (id: number, note: string, status: number): RES<number> => http.post(`/order/update/note?id=${id}&note=${note}&status=${status}`)

// /mall-admin/order/delete 批量删除订单
export const getOrderDeleteTwoApi = (id: number[]): RES<number> => http.post(`/order/delete?ids=${id.join(',')}`)

// /mall-admin/order/update/close 批量关闭订单
export const getUpdateCloseApi = (id: number[], note: string): RES<number> => http.post(`/order/update/close?note=${note}&ids=${id.join(',')}`)

// /mall-admin/returnReason/list 分页查询全部退货原因
export const getReturnReasonApi = (params: returnReasonList): RES<CustomReasonObject> => http.get('/returnReason/list', { params })

// /mall-admin/returnReason/update/status 修改退货原因启用状态
export const getUpdatesStatusApi = (id: number, status: number): RES<number> => http.post(`/returnReason/update/status?ids=${id}&status=${status}`)

// /mall-admin/returnReason/create 添加退货原因
export const getUpdateCreateApi = (params: CustomCreateType): RES<number> => http.post('/returnReason/create', params)

// /mall-admin/returnReason/{id} 获取单个退货原因详情信息
export const getReturnReasonIdApi = (id: number): RES<CustomCreateType> => http.get(`/returnReason/${id}`)

// /mall-admin/returnReason/update/{id} 修改退货原因
export const getUpdateIdApi = (params: CustomCreateType): RES<number> => http.post(`/returnReason/update/${params.id}`, params)

// /mall-admin/returnReason/delete 删除退货原因
export const getReturnDeleteApi = (id: number): RES<number> => http.post(`/returnReason/delete?ids=${id}`)

// /mall-admin/returnReason/delete 批量删除退货原因
export const getReturnBatchDeleteApi = (id: number[]): RES<number> => http.post(`/returnReason/delete?ids=${id.join(',')}`)


// /mall-admin/returnApply/delete 批量删除退货申请
export const getReturnApplyDeleteApi = (id: number[]): RES<number> => http.post(`/returnApply/delete?ids=${id.join(',')}`)

// /mall-admin/returnApply/{id} 获取退货申请详情
export const getReturnApplyIdApi = (id: number): RES<ReturnApplyType> => http.get(`/returnApply/${id}`)

// /mall-admin/companyAddress/list 获取所有收货地址
export const getCompanyAddressApi = (): RES<companyAddress[]> => http.get('/companyAddress/list')

// /mall-admin/returnApply/update/status/{id} 修改退货申请状态
export const getUpdateStatusIdApi = (params: ApplyUpdateStatus): RES<number> => http.post(`/returnApply/update/status/${params.id}`, params)